<template>
  <div id="manage">

    <Header></Header>

    <div class="content">
      <!-- 下面属于各个模块之间的组合 -->
      <!-- 页面导航栏 -->
      <Nav></Nav>
      <main>
        <!-- 页面主要内容-->
        <section>
          <navigation>
            <router-view></router-view>
          </navigation>
        </section>
        <v-footer></v-footer>
      </main>
    </div>
  </div>
</template>

<script>
  // 头部
  import Header from "../components/header/header"
  import Footer from "../components/footer/footer"
  // 导航
  import Nav from "../components/nav/nav"

  export default {
    name: 'manage',

    components: {
      Header,
      Nav,
      'v-footer': Footer
    },
    data() {
      return {
        isNotIndex: true,
        PagePosition: '首页 > 首页',
        // 是否显示模块
        ShowRouterView: true,
      }
    },
    methods: {
      // 显示导航栏选中地址
      showPagePosition(data) {
        this.PagePosition = data;
      },
      reload() {
        console.log('manage')
        this.ShowRouterView = false
        this.$nextTick(() => (this.ShowRouterView = true))
      },
      // 导航栏下page中的页面跳转
      routerChangePosition(data) {
        if (this.PagePosition.indexOf(data) > 0) {
          return
        }
        if (data === 'back') {
          let backIndex = this.PagePosition.lastIndexOf('>')
          this.PagePosition = this.PagePosition.slice(0, backIndex - 1);
        } else {
          this.PagePosition = this.PagePosition + ' > ' + data;
        }
      },
    }
  }
</script>

<style lang="scss">
  @import "../style/entry/manager.scss";
</style>
